#include<stdio.h>
#define ARR_SIZE 80 
main()
{	    	    
	char str[ARR_SIZE];
	int i, num;

	gets(str);
	if(str[0] != ' ' && str[0] != '\0')
	{	    	    
		num = 1;
	}
	else
	{	    	    
		num = 0;
	}
	for(i = 1 ; str[i] != '\0'; i++)
	{	    	    
		if(str[i]  != ' ' && str[i-1]  == ' ')
		{	    	    
			num++;
		}
	}
	printf("num=%d\n", num);
}	    	